package com.nuc.thread.threadpool;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author 诗酒趁年华
 * @version 1.0.0
 * @Description 线程池的execute方法()
 * @createTime 2021年08月01日 17:17:00
 */
@Slf4j
public class Test1 {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(2);

        executorService.execute(()->{
            log.debug("1");
        });

        executorService.execute(()->{
            log.debug("2");
        });

        executorService.execute(()->{
            log.debug("3");
        });
    }
}
